<?php
namespace Admin\Model;

use Think\Model;


class RuleModel extends Model{ 
        
    
    public function addRule(){
        $ruleinfo=D('Auth_rule')->create();
        if (D('Auth_rule')->add($ruleinfo)){
              return true;                
        }else {
            return false;
        }
    }
    
    public function ruleInfo(){
        $RuleId=I("get.id");
        return D('Auth_rule')->find($RuleId);
    }
    
    public function updateInfo(){
        $updateinfo= D('Auth_rule')->create();
        if (D('Auth_rule')->save($updateinfo)){
            return true;
        }else {
            return false;
        }
    }
    
    public function delInfo(){
        $ruleId=I("get.id");
        $map['id']=$ruleId;
        return D('Auth_rule')->where($map)->delete();
    }
}
